<?php

namespace App\Models;

class LoupanRule extends BaseModel
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=11, nullable=false)
     */
    public $id;

    /**
     *
     * @var string
     * @Column(type="string", length=30, nullable=true)
     */
    public $name;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=true)
     */
    public $allow_domains;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=true)
     */
    public $start_urls;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=true)
     */
    public $next_page;

    /**
     *
     * @var string
     * @Column(type="string", length=200, nullable=true)
     */
    public $allow_url;

    /**
     *
     * @var string
     * @Column(type="string", length=200, nullable=true)
     */
    public $extract_from;

    /**
     *
     * @var string
     * @Column(type="string", length=100, nullable=true)
     */
    public $title_xpath;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $body_xpath;

    /**
     *
     * @var string
     * @Column(type="string", length=30, nullable=true)
     */
    public $publish_time_xpath;

    /**
     *
     * @var string
     * @Column(type="string", length=30, nullable=true)
     */
    public $source_site;

    /**
     *
     * @var integer
     * @Column(type="integer", length=1, nullable=true)
     */
    public $enable;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        $this->setSchema("ew_scrapy");
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'loupan_rule';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return LoupanRule[]|LoupanRule
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return LoupanRule
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}
